package com.lagou.edu.course.api;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lagou.edu.course.api.dto.CourseDTO;
import com.lagou.edu.course.api.param.CourseQueryParam;
import com.lagou.edu.response.ResponseDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
/**
 * @author zlg
 */
@FeignClient(name = "edu-course-boot", path = "/course")
public interface CourseRemoteService {

    /**
     * 保存或者更新课程
     * @param courseDTO
     * @return
     */
    @PostMapping(value = "/saveOrUpdateCourse",consumes = "application/json")
    ResponseDTO saveOrUpdateCourse(@RequestBody CourseDTO courseDTO);
    
    /**
     * 分页获取课程列表
     * @param courseQueryParam
     * @return
     */
    @PostMapping(value = "/getQueryCourses",consumes = "application/json")
    Page<CourseDTO> getQueryCourses(@RequestBody CourseQueryParam courseQueryParam);
    
    /**
     * 根据Id获取课程详情
     * @param courseId
     * @return
     */
    @GetMapping("/getCourseById")
    CourseDTO getCourseById(@RequestParam("courseId") Integer courseId);
    
    /**
     * 根据ID修改课程的上下架
     * @param courseId
     * @param status
     * @return
     */
    @GetMapping("/updateCourseStatusById")
    ResponseDTO updateCourseStatusById(@RequestParam("courseId") Integer courseId,@RequestParam("status")Integer status);
}
